from django.shortcuts import render
from app.ser import NewsSer
from app.models import NewsModel
from rest_framework import generics
# Create your views here.
class NewsView(generics.ListCreateAPIView):
    queryset = NewsModel.objects.all()
    serializer_class = NewsSer

class NewsIDView(generics.RetrieveUpdateDestroyAPIView):
    queryset = NewsModel.objects.all()
    serializer_class = NewsSer
    lookup_field = 'pk'
    lookup_url_kwarg = 'id'





